﻿using J.Status.Application.Command.BookingCommand;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.BookingHandler
{
    public class SettlementCreateHandler:IRequestHandler<SettlementCreateCommand,int>
    {
        private readonly IBookingService bookingService;
        public SettlementCreateHandler(IBookingService bookingService)
        {
            this.bookingService = bookingService;
        }

        public async Task<int> Handle(SettlementCreateCommand request, CancellationToken cancellationToken)
        {
            return await bookingService.HandleSettlement(request.Id, request.settlementModel);
        }
    }
}
